// 有多个catch语句的异常处理程序

#include <iostream>
using namespace std;

int main() {
    cout << "有多个catch语句的异常处理程序\n";

    string color;
    cout << "请输入一种颜色(red、blue、green): ";
    getline(cin, color);

    try {
        if (color == "red") {
            cout << "祝你快乐! 你输入的是我最喜欢的颜色!\n";
        }
        else if (color == "blue" || color == "green") {
            throw 100;
        }
        else {
            throw color;
        }
    }
    catch (int i) {
        cout << "你输入的是blue 或 green\n";
    }
    catch (string s) {
        cout << "你输入的是 " << s << ", 不是选项之一\n";
    }
    cout << "完毕!\n";
}